[perf] Replace 3 static inline styles in ChallengeSandbox with CSS classes#113
Draft
github-actions[bot] wants to merge 1 commit intomainfrom
Draft
[perf] Replace 3 static inline styles in ChallengeSandbox with CSS classes#113github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
…sses
Extract Monaco editor loading placeholder (used twice) and Banner
margin-bottom from inline style objects to ChallengeSandbox.module.css
CSS classes. Eliminates 3 style={{ }} objects that force React to
create new objects on every render.
- .editorLoadingPlaceholder: replaces identical 8-property inline style
on Monaco dynamic() loading callback (line 58) and fallback render div
- .solveErrorBanner: wrapper div replacing style={{ marginBottom: 16 }}
on the Primer Banner component
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Pull request created: #113 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tier: 2 — Render & API Performance
Removes 3
style=\{\{ }}inline style objects fromChallengeSandbox.tsxthat caused React to allocate new object literals on every render. Extracts them to static CSS classes inChallengeSandbox.module.css.Baseline
Before this change,
ChallengeSandbox.tsxcontained:style=\{\{ }}object on the Monacodynamic()loading callback div (padding, textAlign, height, minHeight, display, alignItems, justifyContent, backgroundColor, color, fontSize)style=\{\{ marginBottom: 16 }}applied directly on a Primer(Banner)componentstyle=\{\{ }}object on the in-render Monaco fallback div (same properties as ci: bump actions/checkout from 5.0.1 to 6.0.2 #1)Each of these was a static (non-computed) inline style — every render pass created a fresh object literal with no change in value.
Fix
Two new CSS classes added to
ChallengeSandbox.module.css:No visual behaviour change — CSS values are identical to the removed inline styles, using proper design tokens.